using Lzfy_His_Service.Models;

namespace Lzfy_His_Service.Services
{
    public interface ICallLogService
    {
        Task<CallLog?> GetByIdAsync(int id);
        Task<IEnumerable<CallLog>> GetAllAsync();
        Task<IEnumerable<CallLog>> GetByUsernameAsync(string username);
        Task<IEnumerable<CallLog>> GetByCallPhoneAsync(string callPhone);
        /// <summary>
        /// 获取最近的通话记录
        /// </summary>
        /// <param name="minutes">时间范围（分钟）</param>
        /// <returns>通话记录列表</returns>
        Task<IEnumerable<CallLog>> GetRecentAsync(int minutes = 60);

        /// <summary>
        /// 分页查询通话记录
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="username">用户名（可选）</param>
        /// <param name="callPhone">呼叫电话（可选）</param>
        /// <param name="startDate">开始日期（可选）</param>
        /// <param name="endDate">结束日期（可选）</param>
        /// <returns>分页结果</returns>
        Task<CallLogQueryResponse> GetPagedAsync(
            int pageIndex = 1,
            int pageSize = 20,
            string? username = null,
            string? callPhone = null,
            DateTime? startDate = null,
            DateTime? endDate = null);
        Task<int> CreateAsync(CallLogCreateRequest request);
        Task<bool> UpdateAsync(int id, CallLogUpdateRequest request);
        Task<bool> DeleteAsync(int id);
    }
}